package com.fly.springbootTemplate.serviceImpl;

import com.fly.springbootTemplate.dao.BookDao;
import com.fly.springbootTemplate.entity.Book;
import com.fly.springbootTemplate.service.BookService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.Collections;
import java.util.List;

@Component
public class BookServiceImpl implements BookService {
    @Resource
    private BookDao bookDao;
    @Override
    public boolean addBook(Book book) {
        return bookDao.addBook(book);
    }

    @Override
    public boolean deleteBook(Integer id) {
        return bookDao.deleteBook(id);
    }

    @Override
    public boolean updateBook(Book book) {
        return bookDao.updateBook(book);
    }

    @Override
    public List<Book> getAllBook() {
        return bookDao.getAllBook();
    }

    @Override
    public Book getOneBookById(Integer id) {
        return bookDao.getOneBookById(id);
    }
}
